<?php
    
    //error_reporting(E_ERROR | E_WARNING | E_PARSE);
    session_start();

    define('DS', DIRECTORY_SEPARATOR);
    define('PATH_FRM', dirname(__FILE__) );
    define('PATH_TEMP', PATH_FRM . DS . 'temp' . DS );
    define('PATH_SITE', PATH_FRM . DS . '..' . DS );

    require_once PATH_FRM . DS . 'Log.php';
    require_once PATH_FRM . DS . 'Loader.php';
    require_once PATH_FRM . DS . 'Environment.php';
    require_once PATH_FRM . DS . 'DB.php';

    define('ENVIRONMENT',strtolower(Ftl_Environment::detect()));

    require_once PATH_FRM . DS . 'Environment' . DS . 'Config-' . ENVIRONMENT . '.php';

    Ftl_Loader::getInstance();

    $_GET       = Ftl_ArrayUtil::map( $_GET , 'stripslashes' );
    $_POST      = Ftl_ArrayUtil::map( $_POST , 'stripslashes' );
    $_COOKIE    = Ftl_ArrayUtil::map( $_COOKIE , 'stripslashes' );
    $_REQUEST   = Ftl_ArrayUtil::map( $_REQUEST , 'stripslashes' );

    if ( !defined( 'SSL_ENABLED' ) )        define( 'SSL_ENABLED', false );

    if ( !defined( 'PATH_UPLOADS' ) )       define( 'PATH_UPLOADS' , PATH_SITE . 'uploads' . DS);


    if ( !defined( 'DB_TYPE' ) )            define( 'DB_TYPE' , Ftl_DB::PDO );
    if ( !defined( 'DB_PREFIX' ) )          define( 'DB_PREFIX' , "" );
    if ( !defined( 'DB_USE_CACHE' ) )       define( 'DB_USE_CACHE' , false );
    if ( !defined( 'DB_PATH_CACHE' ) )      define( 'DB_PATH_CACHE',PATH_TEMP . 'db' . DS );
    if ( !defined( 'DB_TIMEOUT_CACHE' ) )   define( 'DB_TIMEOUT_CACHE',24 );//horas

    if ( !defined( 'LANG' ) )               define( 'LANG', Ftl_Language::ES );//Defino el idioma en español por default

    define ( 'FB_SCOPE', 'user_about_me,email,user_birthday,user_photos,publish_stream' );

    define ( 'SCRIPT_NAME', Ftl_Path::getScriptName() ); //Pagina actual


    $ioHelper   = new Ftl_IOHelper();
    $ioHelper->addFromArray($_REQUEST);


?>
